package com.changgou.goods.controller;

import com.changgou.common.entity.HttpRespond;
import com.changgou.goods.service.SpecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("goods/spec")
public class SpecController {

    @Autowired
    private SpecService specService;

    /**
     * 根据商品分类名称查询规格列表
     * @param category
     * @return
     */
    @GetMapping("/category")
    public HttpRespond<List<Map>> findListByCategoryName(@RequestParam(name = "category") String category){
        return this.specService.findListByCategoryName(category);
    }

}
